﻿<Page x:Class="Esponce.MainPage"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:m="using:Esponce.Models"
  mc:Ignorable="d">
	<!--<Page.DataContext>
		<m:MainViewModel />
	</Page.DataContext>-->
	<Page.BottomAppBar>
		<AppBar>
			<Grid>
				<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
					<Button AutomationProperties.Name="Scan" Style="{StaticResource PhotoAppBarButtonStyle}" Click="Scan_Click" />
					<Button AutomationProperties.Name="Browse" Style="{StaticResource OpenFileAppBarButtonStyle}" Click="ImportFile_Click" />
				</StackPanel>
			</Grid>
		</AppBar>
	</Page.BottomAppBar>

	<Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootStyle}">
		<Grid.RowDefinitions>
			<RowDefinition Height="140"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>

		<!-- Page title -->
		<Grid Grid.Row="0">
			<TextBlock Grid.Column="1" Text="{StaticResource AppName}" IsHitTestVisible="false" Style="{StaticResource PageHeaderTextStyle}" Margin="36,0,36,36"/>
		</Grid>

		<!-- Create a QR Code -->
		<Grid Grid.Row="1" Margin="36,0,36,36">
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto"/>
				<RowDefinition Height="Auto"/>
				<RowDefinition Height="*"/>
			</Grid.RowDefinitions>

			<TextBlock Grid.Row="0" Text="Enter hyperlink or message" Style="{StaticResource BasicTextStyle}" />

			<Grid Grid.Row="1" Margin="0,7,0,7" >
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="*" />
					<ColumnDefinition Width="Auto" />
				</Grid.ColumnDefinitions>
				<TextBox Grid.Column="0" Text="{Binding Content, Mode=TwoWay}" AcceptsReturn="False" VerticalAlignment="Center" KeyDown="TextBox_KeyDown" />
				<Button Grid.Column="1" Content="Generate" VerticalAlignment="Center" Click="Generate_Click" />
			</Grid>

			<!-- Preview-->
			<Grid Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Center">
				<Image Source="{Binding Image}" Stretch="Uniform" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0,5,0,0" />
				<ProgressRing IsActive="{Binding IsLoading}" IsEnabled="{Binding IsLoading}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" />
			</Grid>
		</Grid>

	</Grid>
</Page>
